package com.bdqn.t320.controller;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.AbstractController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class HelloController extends AbstractController {
    @Override
    protected ModelAndView handleRequestInternal(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws Exception {
        System.out.println("第一个SpringMVC");
        //调用service
        //ModelAndView 模型和视图
        //request.setAttribute(“list”,list);
        //request.getRequestDisaptchServlet("list.jsp").forword(request,response);
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.addObject("name","张三");
        modelAndView.setViewName("hello");
        return modelAndView;
    }
}
